package com.xiaoq.flowrate.repository.impl;

import org.mongodb.morphia.Datastore;
import org.mongodb.morphia.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xiaoq.flowrate.entity.ExtIfEntity;
import com.xiaoq.flowrate.repository.IExtIfRepository;

@Repository
public class ExtIfRepositoryImpl implements IExtIfRepository{
	
	@Autowired
	private Datastore datastore;

	@Override
	public ExtIfEntity findExtIf(String shopId) {
		
		Query<ExtIfEntity> extifQuery = datastore.find(ExtIfEntity.class);
		return extifQuery.field("shopId").equal(shopId).get();
	}

}
